package pkg

import (
	"fmt"
	"hxzkx/global/model"
	"strings"
)

func PayMethodAccountIsOk(method model.PaymentMethod) error {
	if method.PaymentMethodType == "WeChat" {
		if !strings.Contains(method.PaymentAccount, "wx") {
			return fmt.Errorf("微信格式错误")
		}
	}
	if method.PaymentMethodType == "Alipay" {
		if method.PaymentAccount != "hjppij5951@sandbox.com" {
			return fmt.Errorf("支付宝账号未注册")
		}
	}
	return nil
}
